package com.ly.drivingschool.dao;

import com.ly.drivingschool.pojo.Order;
import com.ly.drivingschool.pojo.OrderPage;
import com.ly.drivingschool.pojo.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderDao {
    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    // 添加新的订单
    int insertSelective(Order record);

    // 根据id查询信息
    OrderPage selectByPrimaryKey(Integer orderId);
    // 根据id更新一条记录
    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);
    // 分页查询
    List<OrderPage> findByPager(Map<String, Object> params);
    // 模糊查询
    List<OrderPage> findByKey(Map<String, Object> params);
    // 选择条件查询
    List<OrderPage> findByCondition(Map<String, Object> params);
    // 根据用户id获取订单信息
    Order getOrderByUserId(int user_id);

    // 总数
    // 汇总数据
    long count();
    long countDD001(String col,String code);
    long countKey(String keyWork);
}